home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_test.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  68 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_test.cog    The camera shakes a sector is entered.
  4. #
  5. # [GGJ]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        startup
  13. message        entered
  14. message     timer
  15.  
  16. surface        shakeSurface                   
  17. thing        player                local
  18.  
  19. int            duration=0            local
  20. int            once=0                local
  21.  
  22. vector        posOffset            local    #xyz direction for the camera to jump to
  23. vector        angOffset            local    #pyr direction for the camera to turn to
  24.  
  25. flex        posDelta=10.0        local    #units per frame that the camera moves back
  26. flex        angDelta=180.0        local    #degrees per frame that the camera moves back
  27.  
  28. end
  29. # ========================================================================================
  30. code
  31. startup:
  32.     player=GetLocalPlayerThing();
  33.     return;
  34.  
  35. entered:
  36.     if (once == 1) return;
  37.     once = 1;
  38.     
  39.     SetTimer(Rand() * 0.3);
  40.     return;
  41.     
  42. timer:
  43.     duration = duration + 1;
  44.     if (duration < 7)
  45.     {
  46.         SetTimer(Rand() * 0.3);
  47.     }
  48.     else
  49.     {
  50.         once = 0;
  51.         duration = 0;
  52.     }
  53.     posOffSet = VectorSet(RandBetween(-2, 2) * 0.001, RandBetween(-2, 2) * 0.001, RandBetween(-2, 2) * 0.001);
  54.     #first number kicks the camera to the right(pos) or left(neg)
  55.     #middle number kicks the camera forward(pos) or back(neg)
  56.     #last number pops camera straight up(pos) or down(neg) 
  57.     
  58.     angOffSet = VectorSet(RandBetween(-7, 7), RandBetween(-5, 5), RandBetween(-3, 3));
  59.     #angOffSet = VectorSet(0, 0, 0);
  60.         #These numbers are tripled for 3rd person
  61.     #first number makes camera shift down(positive) or up(negative)
  62.     #middle number makes camera shift to right(positive) or left(negative)
  63.     #last number makes camera shift to lower right(positive) or lower left(negative)
  64.     
  65.     SetPOVShake(posOffSet, angOffSet, posDelta, angDelta);
  66.     return;
  67. end
  68.